package com.ruoyi.web.controller.admin;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.vo.BdmStatisticsMemberNumberVo;
import com.ruoyi.system.service.IBdmMemberRuleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.ruoyi.common.core.domain.AjaxResult.success;


@Api(tags = "后台-会员分析统计")
@RestController
@RequestMapping("/admin/statistics")
public class BdmStatisticsController {


    @Autowired
    private IBdmMemberRuleService iBdmMemberRuleService;


    /**
     * @return {@link BdmStatisticsMemberNumberVo}  @link 后面是实体类
     */
    @ApiOperation("统计最近五天每天的新增会员数及会员总数")
    @GetMapping("/statisticsMemberNumber")
    public AjaxResult statisticsMemberNumber(){
        return success(iBdmMemberRuleService.statisticsMemberNumber());
    }


    @ApiOperation("统计最近五天每天的会员活跃数量")
    @GetMapping("/statisticsMemberActiveNumber")
    public AjaxResult statisticsMemberActiveNumber(){
        return success(iBdmMemberRuleService.statisticsMemberActiveNumber());
    }

    @ApiOperation("统计会员等级分布")
    @GetMapping("/statisticsMemberLevelDistribution")
    public AjaxResult statisticsMemberLevelDistribution(){
        return success(iBdmMemberRuleService.statisticsMemberLevelDistribution());
    }

    @ApiOperation("统计新老客户成交金额级新老客户成交数量")
    @GetMapping("statisticsUserMakeNumber")
    public AjaxResult statisticsUserMakeNumber(){
        return success(iBdmMemberRuleService.statisticsUserMakeNumber());
    }
}
